package com.robooot.business_counter.model;

import java.io.Serializable;

public class Token implements Serializable {

    private static final long serialVersionUID = 4423128400084477496L;

    private String ip; // header
    private String clientType; // header
    private String clientId; // cookies
    private String userId; // cookies
    private int roles; // cookies

    public String getIp() {
        return ip;
    }

    public void setIp(String ip) {
        this.ip = ip;
    }

    public String getClientType() {
        return clientType;
    }

    public void setClientType(String clientType) {
        this.clientType = clientType;
    }

    public String getClientId() {
        return clientId;
    }

    public void setClientId(String clientId) {
        this.clientId = clientId;
    }

    public String getUserId() {
        return userId;
    }

    public void setUserId(String userId) {
        this.userId = userId;
    }

    public int getRoles() {
        return roles;
    }

    public void setRoles(int roles) {
        this.roles = roles;
    }

    public boolean hasRoles(int roles) {
        return (this.roles & roles) != 0;
    }

}
